package com.itgungnir.designpattern.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * Animal集合
 */
public class AnimalCollection {
	private List<String> animals;

	public AnimalCollection() {
		this.animals = new ArrayList<>();
	}

	public void addAnimal(String animal) {
		animals.add(animal);
	}

	public Iterator iterator() {
		return new AnimalIterator(animals);
	}
}